package com.misty.dao.vo;


import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
public class BlogTagVo {

    private Integer id; //id
    private String title; //标题
    private String content; //内容
    private String firstPicture; //首图
    private Boolean likeBoolean; //是否点赞
    private Integer likesCount; //点赞数
    private Boolean collectionBoolean; //是否收藏
    private Integer collectionCount; //收藏数
    private String flag; //标记
    private Integer views; //浏览次数
    private boolean appreciation; //赞赏开启
    private boolean shareStatement; //版权开启
    private boolean commentabled; //评论开启
    private boolean published; //发布
    private boolean recommend; //推荐
    private String tagName; //标签
    private List<String> tagList; //标签列表
    private LocalDateTime createTime = LocalDateTime.now(); //创建时间
    private LocalDateTime updateTime; //更新时间

    @TableField(value = "user_id")
    private Integer userId;

    public String getTagName() {
        if(CollUtil.isEmpty(tagList)){
            return "";
        }
        return String.join(",",tagList);
    }
}

